package com.example.rest.controller;

import com.alibaba.fastjson.JSONObject;

import com.example.base.app.AppCall;
import com.example.base.jdbc.DBSql;
import com.example.base.jdbc.SqlBuilder;
import com.example.base.security.SecurityUtil;
import com.example.base.utils.Result;

import com.example.rest.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/rest")
public class RestDemoController {





    @GetMapping("/test1")
    public JSONObject test1Controller() throws IOException, SQLException {
//        TestUser testUser=new TestUser();
//        testUser.setUserName("haha");

        SqlBuilder sqlBuilder=new SqlBuilder();
        sqlBuilder.select("username");
        sqlBuilder.from("sys_user");


        List<Map<String,Object>> mapList=DBSql.getMaps(sqlBuilder.getSql());
        // List<TestUser> userList=testUserMapper.selectList(new LambdaQueryWrapper<>());
        //String info=testService.getTest();
        return Result.successInfo(mapList);
    }


}
